package com.blog.personalblog.controller;

import com.blog.personalblog.config.page.PageRequest;
import com.blog.personalblog.config.page.PageResult;
import com.blog.personalblog.entity.ArticleTag;
import com.blog.personalblog.entity.Tag;
import com.blog.personalblog.service.ArticleTagService;
import com.blog.personalblog.service.TagService;
import com.blog.personalblog.util.JsonResult;
import com.blog.personalblog.util.PageUtil;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

@Api(tags = "ArticleTagList")
@RestController
@RequestMapping("/articletag")
public class ArticleTagController {
    @Autowired
    ArticleTagService articleTagService;

    @ApiOperation(value = "ArticleTagList")
    @PostMapping("/list")
    public JsonResult<Object> listArticleTag(){
        List<ArticleTag> articleTagList = articleTagService.findAll();
        return JsonResult.success(articleTagList);
    }
    @ApiOperation(value = "InsertArticleTag")
    @PostMapping("/create")
    public JsonResult<Object> createArticleTag(@RequestBody @Valid ArticleTag articleTag){
        articleTagService.insertArticleTag(articleTag);
        return JsonResult.success();
    }
    @ApiOperation(value = "InsertBatchArticleTag")
    @PostMapping("/batch")
    public JsonResult<Object> batchArticleTag(){
        return JsonResult.success();
    }
}
